﻿var page = {

    citys: [
        { address: '龙港区', distance: '10', level: '★★★' },
        { address: '甘井子区', distance: '7', level: '★★' },
        { address: '高新园区', distance: '78', level: '★★★' },
        { address: '新都区', distance: '99', level: '★★' },
        { address: '于洪区', distance: '55', level: '★' },
        { address: '铁新区', distance: '12', level: '★★' },
        { address: '玉皇区', distance: '66', level: '★★' },
        { address: '杨长子区', distance: '15', level: '★★' },
        { address: '牡丹区', distance: '16', level: '★★' },
    ],

    /* 此方法在第一次显示窗体前发生 */
    onLoad: function (event) {
        var array = [];
        for (var i = 0, len = this.citys.length; i < len; i++) {
            var obj = {};
            obj.address = { value: this.citys[i].address };
            obj.distance = { value: this.citys[i].distance };
            obj.level = { value: this.citys[i].level };
            array.push(obj);
        }
        this.setData({
            listctrl1: {
                list: {
                    page: this,
                    items: [
                        {
                            xml: 'Panels/safe_plase',
                            items: array
                        }
                    ]
                }
            }
        })
    },

    /* 此方法展示窗体后发生 */
    onResume: function (event) {

    },

    /* 当前页状态变化为显示时触发 */
    onShow: function (event) {

    },

    /* 当前页状态变化为隐藏时触发 */
    onHide: function (event) {

    },

    /* 此方法关闭窗体前发生 */
    onExit: function (event) {

    },

    btn_change: function (event) {
        pm.navigateBack('main_page/main_page')
    },
};

Page(page);

page = 0;
